home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Franz PD / Franz PD Disk #094 (1990-10)(Amiga User Group Deutschland e.V.).zip / Franz PD Disk #094 (1990-10)(Amiga User Group Deutschland e.V.).adf / Demos / mousecrash.asm < prev    next >
Assembly Source File  |  1990-09-11  |  3KB  |  110 lines

  1. * MouseCrash by E.Hambuch
  2. * V0.0 18.5.90
  3. * Demo, darf nicht veraendert werden !
  4. * Linken:  BLINK MouseCrash.o Samp.o TO MouseCrash CHIP
  5.   include 'exec.i'
  6.   include 'intuition.i'
  7.   include 'startup.i'
  8. _main:
  9.   lea intname,a1               ;Libs oeffnen
  10.   CALLEXEC OldOpenLibrary
  11.   move.l d0,_IntBase
  12.   beq ende
  13.   lea windowstr,a0             ;Fenster
  14.   CALLINT OpenWindow
  15.   move.l d0,Window
  16.   beq closeint
  17.   move.l d0,a0
  18.   move.l 86(a0),MsgPort       ;Window->MsgPort
  19.   lea IntStr5,a1              ;Interrupt fuer Vertikal-Blank
  20.   moveq #5,d0                 ;einfuegen
  21.   CALLEXEC AddIntServer
  22.   lea IntStr7,a1              ;Und Interrupt fuer Kanal 0 setzen
  23.   moveq #7,d0
  24.   jsr _LVOSetIntVector(A6)
  25.   move.w #$0001,$dff096       ;Sound DMA abschalten
  26. forever: move.l MsgPort,a0    ;auf Nachricht warten
  27.   CALLEXEC WaitPort
  28.   move.l MsgPort,a0
  29.   jsr _LVOGetMsg(a6)
  30.   move.l d0,a1
  31.   jsr _LVOReplyMsg(a6)
  32.   lea IntStr5,a1               ;Interrups entfernen
  33.   moveq #5,d0
  34.   jsr _LVORemIntServer(a6)
  35.   move.w #$0001,$dff096               ;Sound DMA aus
  36.   move.w #%00000000010000000,$dff09a  ;Kanal 0-Interrupt abschalten
  37. closewin:                             ;alles schliessen
  38.   move.l Window,a0
  39.   CALLINT CloseWindow
  40. closeint:
  41.   move.l _IntBase,a1
  42.   CALLEXEC CloseLibrary
  43. ende: rts
  44. Interrupt5:                         ;Interrupt-Routine
  45.   movem.l d0/a0/a4,-(sp)
  46.   btst #6,$bfe001
  47.   bne endint5
  48.   lea $dff000,a4
  49.   move.w #%0000000010000000,$09a(a4)
  50.   lea SoundData,a0
  51.   addq.l #4,a0
  52.   move.w #$0001,$96(a4)
  53.   move.l (a0)+,d0
  54.   lsr.l #1,d0
  55.   move.w d0,$0a4(a4)
  56.   move.w (a0)+,$0a6(a4)
  57.   move.l a0,$0a0(a4)
  58.   move.w #64,$0a8(a4)
  59.   move.w #$780,$09c(a4)
  60.   move.b #2,Status
  61.   move.w #%1000000010000000,$09a(a4)
  62.   move.w #$8001,$096(a4)
  63. endint5: movem.l (sp)+,d0/a0/a4
  64.   rts
  65. Interrupt7:
  66.   movem.l d0,-(sp)
  67.   move.w $dff01e,d0
  68.   and.w #$780,d0
  69.   move.w d0,$dff09c
  70.   subq.b #1,Status
  71.   bne.s endint7
  72.   move.w #$0001,$dff096
  73.   move.w #%0000000010000000,$dff09a
  74. endint7: movem.l (sp)+,d0
  75.   rts
  76. intname: INTNAME
  77. segptr:    dc.l 0
  78. _IntBase:  dc.l 0
  79. Window:    dc.l 0
  80. MsgPort:   dc.l 0
  81. Status:    dc.w 0
  82. windowstr:
  83.   dc.w 0,0,310,10
  84.   dc.b 0,1
  85.   dc.l CLOSEWINDOW
  86.   dc.l WINDOWDEPTH!WINDOWDRAG!WINDOWCLOSE
  87.   dc.l 0,0,Titel,0,0
  88.   dc.w 0,0,0,0,WBENCHSCREEN
  89. IntStr5:
  90.   dc.l 0,0
  91.   dc.b 2,0
  92.   dc.l IntName5
  93.   dc.l 0,Interrupt5
  94. IntStr7:
  95.   dc.l 0,0
  96.   dc.b 2,127
  97.   dc.l IntName7
  98.   dc.l 0,Interrupt7
  99. IntName5: dc.b 'MC-Mouse-Interrupt',0
  100. IntName7: dc.b 'MC-Sound-Interrupt',0
  101. Titel: dc.b 'MouseCrash V0.0 by E.Hambuch',0
  102.   xref SoundData
  103. ; Fuer eigenes File SAMP.o:
  104. ; SAMP-File (erzeugt mit Playsample) mit HexDump in Quellcode wandeln
  105. ; An Anfang:   DATA CHIP
  106. ;           SoundData:
  107. ;             xdef SoundData
  108. ; An Ende:    END
  109.   END
  110.